package com.utils;

import org.hibernate.SessionFactory;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;

public class HibernateUtils {
   private static final SessionFactory sessionfactory;
   static{
	   StandardServiceRegistry sr = new StandardServiceRegistryBuilder().configure().build();
		sessionfactory = new MetadataSources(sr).buildMetadata().buildSessionFactory();
	   
	   
	   
   }
	
   public static SessionFactory  getSessionFactory(){
	   return sessionfactory;
   }
	public static void closeSessionFactory(){
		sessionfactory.close();
	}
	
}
